package hong.jun.pet_home.service.org.impl;

import hong.jun.basic.base.service.impl.BaseServiceImpl;
import hong.jun.pet_home.domain.org.Employee;
import hong.jun.pet_home.mapper.EmployeeMapper;
import hong.jun.pet_home.service.org.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {
    @Autowired
    private EmployeeMapper mapper;

    @Override
    public void audit(Employee employee) {
        if (employee.getState() == 0) {//状态码为0进行激活操作
            employee.setStateid(1);//设置冗余字段 将要更改的状态
            mapper.audit(employee);
        } else if (employee.getState() == 1) {//状态码为01进行禁用操作
            employee.setStateid(-1);//设置冗余字段 将要更改的状态
            mapper.audit(employee);
        }

    }
}
